require("../common/bootstrap/js/Chart");

$(document).ready(function (e) {
    new Chart($("#monthincome"), {
      type: 'line',
      data: {
        labels: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
        datasets: [{
          label: "收入额度",
          fill: false,
          borderWidth: 3,
          pointRadius: 4,
          borderColor: "#36a2eb",
          backgroundColor: "#36a2eb",
          pointBackgroundColor: "#36a2eb",
          pointBorderColor: "#36a2eb",
          pointHoverBackgroundColor: "#fff",
          pointHoverBorderColor: "#36a2eb",
          data: [170, 125, 205, 253, 200, 190, 160, 191, 283, 115, 275, 193]
        },
        {
          label: "退款额度",
          fill: false,
          borderWidth: 3,
          pointRadius: 4,
          borderColor: "#ff6384",
          backgroundColor: "#ff6384",
          pointBackgroundColor: "#ff6384",
          pointBorderColor: "#ff6384",
          pointHoverBackgroundColor: "#fff",
          pointHoverBorderColor: "#ff6384",
          data: [88, 75, 65, 51, 110, 19, 60, 51, 158, 55, 55, 113]
        }]
      },
      options: {}
    });

    new Chart($("#weekincome"), {
      type: 'line',
      data: {
        labels: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
        datasets: [{
          label: "收入额度",
          backgroundColor: "rgba(51,202,185,0.5)",
          borderColor: "rgba(0,0,0,0)",
          pointBackgroundColor: "rgba(51,202,185,0.5)",
          pointBorderColor: "#fff",
          pointHoverBackgroundColor: "#fff",
          pointHoverBorderColor: "rgba(51,202,185,0.5)",
          data: [29, 59, 80, 58, 200, 55, 40]
        },
        {
          label: "退款额度",
          backgroundColor: "rgba(183,185,186,0.8)",
          borderColor: "rgba(0,0,0,0)",
          pointBackgroundColor: "rgba(243,245,246,0.8)",
          pointBorderColor: "#fff",
          pointHoverBackgroundColor: "#fff",
          pointHoverBorderColor: "rgba(243,245,246,0.8)",
          data: [28, 48, 40, 19, 86, 27, 90]
        }]
      },
      options: {}
    });

    new Chart($("#monthorders"), {
      type: 'line',
      data: {
        labels: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
        datasets: [
          {
            label: "收入",
            fill: false,
            borderWidth: 3,
            pointRadius: 0,
            borderColor: "#57C43C",
            pointBackgroundColor: "#57C43C",
            pointBorderColor: "#57C43C",
            pointHoverBackgroundColor: "#fff",
            pointHoverBorderColor: "#57C43C",
            data: [120, 125, 105, 153, 100, 90, 160, 111, 133, 115, 135, 123]
          }
        ]
      },
      options: {
        legend: {
          display: false
        },
      }
    });

    new Chart($("#weekorders"), {
      type: 'line',
      data: {
        labels: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
        datasets: [{
          label: "收入",
          fill: false,
          borderWidth: 3,
          pointRadius: 5,
          borderColor: "#2292DD",
          pointBackgroundColor: "#2292DD",
          pointBorderColor: "#2292DD",
          pointHoverBackgroundColor: "#fff",
          pointHoverBorderColor: "#2292DD",
          data: [120, 125, 105, 153, 100, 90, 160]
        }]
      },
      options: {
        legend: {
          display: false
        },
      }
    });

    new Chart($("#categorysales"), {
      type: 'pie',
      data: {
        labels: ["种类1", "种类2", "种类3", "种类4", "种类5"],
        datasets: [{
          data: [300, 50, 100,60,70],
          backgroundColor: ['rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)','rgba(231, 233, 237, 0.95)', 'rgba(54, 262, 235, 0.95)']
        }]
      },
      options: {
        responsive: false
      }
    });

    new Chart($("#shopssales"), {
      type: 'doughnut',
      data: {
        labels: ["商铺1", "商铺2", "商铺3", "商铺4", "商铺5"],
        datasets: [{
          data: [300, 50, 100,30,50],
          backgroundColor: ['rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)','rgba(231, 233, 237, 0.95)', 'rgba(54, 262, 235, 0.95)']
        }]
      },
      options: {
        responsive: false
      }
    });
  });